#ifndef _CALLBACK_
#define _CALLBACK_

#include <memory>
#include <functional>

class Buffer;
class TcpConnection;
class Timestamp;

using TcpConnectionPtr = std::shared_ptr<TcpConnection>;
using ConnectionCallback = std::function<void(const TcpConnectionPtr&)>;
using CloseCallback = std::function<void(const TcpConnectionPtr&)>;
using WriteCallback = std::function<void(const TcpConnectionPtr&)>;
using MessageCallback = std::function<void(const TcpConnectionPtr&, Buffer*, Timestamp)>;

//平衡发送方和接收方的速率，防止二者速率相差太大导致丢包现象严重
using HighWaterMarkCallback = std::function<void(const TcpConnectionPtr&, size_t t)>;

#endif